<template>

	<div id="app">
		<Header class="header"></Header>
		<Nav class="sidebar" v-show="flag"></Nav>
		<router-view></router-view>
	</div>
</template>
		
		
		
			


<script>

import Header from '@/components/Header'
import Nav from '@/components/Nav'
import NotFound from '@/components/NotFound'
import { mapGetters } from 'vuex'
export default {
	
components: {
  	Header,
    Nav,
    NotFound,
  },
computed: {
			// 获取仓库里的title
			...mapGetters(['flag','location'])
	},
created(){
	this.getCity();
	this.resetWidth();
},
 		
methods:{
  	getCity(){
		var myCity = new BMap.LocalCity();
		myCity.get((res)=>{

			this.$store.commit('getCurrentLocation',res.name)
		})
	},
	
	resetWidth(){
		let baseWidth = document.documentElement.clientWidth || document.body.clientWidth;
		console.log(baseWidth);
		document.documentElement.style.fontSize = baseWidth * 100 / 375 + 'px'
	}
  }
}
</script>

<style lang="less">
	@import './assets/styles/reset.css';
	@import './assets/styles/common.less';
	
body{
  background: #EBEBEB;
}

.header{
position: relative;
}
.sidebar{
	width: 2.65rem;
	position: absolute;
	z-index: 100;
	height: 100%;
	background: #282828;
	
}

</style>
